<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script>
    window.onload = function() {
        var myCanvas=document.getElementById("myCanvas");
        var context = myCanvas.getContext("2d"); 
        context.translate(240,120);
        context.fillStyle = "rgba(0,0,250,0.25)";
        //画90个矩阵
        for(var i=0;i<90;i++) {
            context.scale(0.95,0.95);//下一个矩阵长和宽都缩小0.93倍
            context.rotate(Math.PI/9);
            context.translate(35,12);
            context.fillRect(80,0,100,50);
        }
    }
</script>
<body>
    <canvas id="myCanvas" width="600px" height="600px" style="background:cornsilk"></canvas>
</body>
</html>